London | 25-SDC-Nov | Jesus del Moral | Sprint 1| Individual Shell Tools#204
London | 25-SDC-Nov | Jesus del Moral | Sprint 1| Individual Shell Tools#204delmorallopez wants to merge 8 commits intoCodeYourFuture:mainfrom
Conversation
|
Your PR's title isn't in the expected format. Please check the expected title format, and update yours to match. Reason: Wrong number of parts separated by |s If this PR is not coursework, please add the NotCoursework label (and message on Slack in #cyf-curriculum or it will probably not be noticed). |
|
Your PR's title isn't in the expected format. Please check the expected title format, and update yours to match. Reason: Wrong number of parts separated by |s If this PR is not coursework, please add the NotCoursework label (and message on Slack in #cyf-curriculum or it will probably not be noticed). |
|
Your PR couldn't be matched to an assignment in this module. Please check its title is in the correct format, and that you only have one PR per assignment. If this PR is not coursework, please add the NotCoursework label (and message on Slack in #cyf-curriculum or it will probably not be noticed). |
LonMcGregor
left a comment
There was a problem hiding this comment.
Good start on this sprint's tasks, I have spotted a few areas where you could improve code further
| # I was tempted to take a bite of it. | ||
| # But this seemed like a bad idea... | ||
|
|
||
| cat ../helper-files/helper-1.txt ../helper-files/helper-2.txt ../helper-files/helper-3.txt |
There was a problem hiding this comment.
Is there a way of doing the same without manually listing every file?
There was a problem hiding this comment.
The function has been modified
|
|
||
|
|
||
|
|
||
| nl -b a ../helper-files/helper-1.txt ../helper-files/helper-2.txt ../helper-files/helper-3.txt |
There was a problem hiding this comment.
See my comment above about using a wildcard instead of listing each file
There was a problem hiding this comment.
The function has been modified
| # TODO: Write a command to output the number of lines in dialogue.txt that contain the word Doctor (regardless of case). | ||
| # The output should be exactly the number 9. | ||
|
|
||
| grep -n "Doctor" dialogue.txt -i | wc -l |
There was a problem hiding this comment.
Is there an option you can use instead of piping to wc?
There was a problem hiding this comment.
The function has been modified
| # The output should show that dialogue.txt contains 6 lines, dialogue-2.txt contains 2, and dialogue-3.txt contains 0. | ||
|
|
||
| for f in *.txt; do | ||
| echo "$f: $(grep -i "^Doctor:" "$f" | wc -l)" |
There was a problem hiding this comment.
This is an interesting approach. It should be possible to complete with a single grep command, though. Can you figure out how?
|
Great, this looks finished now |
LONDON | 2025-NOV-SDC | Sprint1
Individual shell tools